package addressBook;

/**
 * @author Jarvan
 * @version 1.0
 * @create 2020/11/13 9:09
 */
public class BaseBinaryTree<E> {
    /**
     * Root of the tree.
     */
    protected TreeNode<E> root;
    public boolean isEmpty(){
        return root==null;
    }

    /**
     * Make is binary empty.
     */
    public void makeEmpty(){
        this.root = null;
    }

    /**
     * Get the root of the binary  tree.
     * @return root node of the binary  tree.
     */
    public TreeNode<E> getRoot(){
        return this.root;
    }

    /**
     * Set root node for this binary tree.
     */
    public void setRoot(TreeNode<E> root){
        this.root = root;
    }
}
